import './assets/main.scss'

import {createApp} from 'vue'

//导入pinia
import {createPinia} from 'pinia'
import {createPersistedState} from 'pinia-plugin-persistedstate'

import App from './App.vue'

//导入路由
import router from './router'

// 引入element-plus
import ElementPlus from 'element-plus';//导入ElementPlus
import 'element-plus/dist/index.css';//导入ElementPlus的样式
import locale from 'element-plus/es/locale/lang/zh-cn'; // 引入中文语言包

// 引入element-plus的icon图标
import * as ElIconModules from '@element-plus/icons'



// 引入pinia-plugin-persistedstate
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'



const app = createApp(App)//创建应用实例
const pinia = createPinia()
const persist = createPersistedState()
pinia.use(persist)
pinia.use(piniaPluginPersistedstate)
app.use(pinia)
app.use(router)

app.use(ElementPlus, {locale});//使用element-plus,使用中文包

for (let iconName in ElIconModules) {
    app.component(iconName, ElIconModules[iconName])
}

app.mount('#app')
